package com.ruoyi.system.Advice;

import com.ruoyi.system.exception.FileUnzipException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.util.HashMap;
import java.util.Map;

@ControllerAdvice
public class AOPExceptionHandler {

    @ExceptionHandler(FileUnzipException.class)
    public Map<String,String> handleFileUnzipException(FileUnzipException ex) {
        Map<String,String> errormap  = new HashMap<>();
        errormap.put("error",ex.getMessage());
        return errormap;
    }
}

